package com.jnevision.handclap.model;

import java.io.Serializable;

import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.jnevision.util.DateUtil;

/**
 * <p>
 * 随手拍
 * </p>
 *
 * @author gavin
 * @since 2019-07-16
 */
@TableName("b_hand_clap")
public class HandClap extends Model<HandClap> {
    private static final long serialVersionUID = -4725009040013683040L;

    @TableId(value = "id", type = IdType.UUID)
    private String id;

    /**
     * 位置
     */
    @TableField("position")
    private String position;

    /**
     * 联系人
     */
    @TableField("contacts")
    private String contacts;

    /**
     * 联系方式
     */
    @TableField("contact_information")
    private String contactInformation;

    /**
     * 图片
     */
    @TableField("picture")
    private String picture;

    /**
     * 问题描述
     */
    @TableField("problem")
    private String problem;

    /**
     * 优先级
     */
    @TableField("priority")
    private Integer priority;

    /**
     * 提交人
     */
    @TableField("user_id")
    private String userId;

    /**
     * 部门
     */
    @TableField("dept_id")
    private Integer deptId;

    /**
     * 完成人
     */
    @TableField("finish_id")
    private String finishId;

    /**
     * 是否完成
     */
    @TableField("is_finish")
    private Boolean finish;

    /**
     * 分配人
     */
    @TableField("distributor_id")
    private String distributorId;
    /**
     * 完成时间
     */
    @TableField("finish_time")
    private String finishTime;
    /**
     * 下发时间
     */
    @TableField("rec_time")
    private String recTime;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private String createTime = DateUtil.getNormalTime();

    @TableField("task_name")
    private String taskName;
    @TableField("finish_desc")
    private String finishDesc;
    @TableField("finish_pic")
    private String finishPic;

    /**
     * 完成人
     */
    @TableField(exist = false)
    private String finishName;
    @TableField(exist = false)
    /**
     * 提交人
     */
    private String userName;
    @TableField(exist = false)
    /**
     * 分配人
     */
    private String distributor;
    @TableField(exist = false)
    private String[] pictures;

    public String getFinishName() {
        return this.finishName;
    }

    public void setFinishName(String finishName) {
        this.finishName = finishName;
    }

    public String[] getPictures() {
        return this.pictures;
    }

    public void setPictures(String[] pictures) {
        this.pictures = pictures;
    }

    public String getDistributor() {
        return this.distributor;
    }

    public void setDistributor(String distributor) {
        this.distributor = distributor;
    }

    public String getUserName() {
        return this.userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getTaskName() {
        return this.taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getFinishDesc() {
        return this.finishDesc;
    }

    public void setFinishDesc(String finishDesc) {
        this.finishDesc = finishDesc;
    }

    public String getFinishPic() {
        return this.finishPic;
    }

    public void setFinishPic(String finishPic) {
        this.finishPic = finishPic;
    }

    public String getFinishTime() {
        return this.finishTime;
    }

    public void setFinishTime(String finishTime) {
        this.finishTime = finishTime;
    }

    public String getRecTime() {
        return this.recTime;
    }

    public void setRecTime(String recTime) {
        this.recTime = recTime;
    }

    public String getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getContacts() {
        return contacts;
    }

    public void setContacts(String contacts) {
        this.contacts = contacts;
    }

    public String getContactInformation() {
        return contactInformation;
    }

    public void setContactInformation(String contactInformation) {
        this.contactInformation = contactInformation;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        if (StringUtils.isNotBlank(picture)) {
            this.pictures = picture.split("<>");
        }
        this.picture = picture;
    }

    public String getProblem() {
        return problem;
    }

    public void setProblem(String problem) {
        this.problem = problem;
    }

    public Integer getPriority() {
        return priority;
    }

    public void setPriority(Integer priority) {
        this.priority = priority;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Integer getDeptId() {
        return deptId;
    }

    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }

    public String getFinishId() {
        return finishId;
    }

    public void setFinishId(String finishId) {
        this.finishId = finishId;
    }

    public Boolean isFinish() {
        return finish;
    }

    public void setFinish(Boolean finish) {
        this.finish = finish;
    }

    public String getDistributorId() {
        return distributorId;
    }

    public void setDistributorId(String distributorId) {
        this.distributorId = distributorId;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "HandClap{" + "id=" + id + ", position=" + position + ", contacts=" + contacts + ", contactInformation="
            + contactInformation + ", picture=" + picture + ", problem=" + problem + ", priority=" + priority
            + ", userId=" + userId + ", deptId=" + deptId + ", finishId=" + finishId + ", finish=" + finish
            + ", distributorId=" + distributorId + "}";
    }
}